﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="Finance.GetQuotePage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Finance"
    xmlns:common="using:Finance.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">My Application</x:String>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Style="{StaticResource LayoutRootStyle}" Width="520" HorizontalAlignment="Left">
        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="30"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}" Visibility="Collapsed"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Style="{StaticResource PageHeaderTextStyle}" FontSize="24" Text="Get Quote" Margin="0,0,30,0"/>
        </Grid>
        <StackPanel Grid.Row="1" Margin="30,10,0,0">
        	<StackPanel Orientation="Horizontal">
        		<RadioButton x:Name="rbtnNSE" Content="NSE" VerticalAlignment="Stretch" Height="33" Style="{StaticResource TopAppBarRadioButtonStyle}" FontSize="13.333" FontWeight="Bold" IsChecked="True"/>
        		<RadioButton x:Name="rbtnBSE" Content="BSE" VerticalAlignment="Stretch" Height="33" Style="{StaticResource TopAppBarRadioButtonStyle}" FontSize="13.333" FontWeight="Bold" Margin="5,0,0,0"/>
        	</StackPanel>
        	<TextBlock TextWrapping="Wrap" Text="Scrip Name" FontFamily="Segoe UI" FontSize="13.333" FontWeight="SemiLight" Margin="0,20,0,0"/>
        	<TextBox TextWrapping="Wrap" MaxWidth="270" Margin="0,5,0,0" HorizontalAlignment="Left" MinWidth="270" Background="#FFCECECE" BorderBrush="#FFCECECE"/>
        	<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
        		<RadioButton x:Name="rbtnINDEX" Content="INDEX" VerticalAlignment="Stretch" Height="33" Style="{StaticResource TopAppBarRadioButtonStyle}" FontSize="13.333" FontWeight="Bold" IsChecked="True"/>
        		<RadioButton x:Name="rbtnEQUITY" Content="EQUITY" VerticalAlignment="Stretch" Height="33" Style="{StaticResource TopAppBarRadioButtonStyle}" FontSize="13.333" FontWeight="Bold" Margin="5,0,0,0"/>
        	</StackPanel>
        	<Button x:Name="btnGetQuote" Content="Get Quote" HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="0,40,0,0" BorderThickness="0" Padding="20,5" Style="{StaticResource btnGetQuoteStyle}" Tapped="btnGetQuote_Tapped"/>
        	<StackPanel x:Name="spResult" Margin="0,30,30,0" Visibility="Collapsed">
        		<ListView Margin="0,0,15,0" SelectionMode="None">
        			<StackPanel x:Name="sp1" Width="440" Height="41" Background="#FF1D1D1D">
        				<Grid Margin="5,10,5,12" VerticalAlignment="Center">
        					<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Lorem " VerticalAlignment="Top" FontSize="13.333" Foreground="#FFC4C4C4"/>
        					<TextBlock HorizontalAlignment="Right" TextWrapping="Wrap" Text="NFO" VerticalAlignment="Center" FontSize="13.333" Foreground="#FFC4C4C4" Margin="0,0,20,0"/>
        				</Grid>
        				<Rectangle Fill="#FF464646" Height="1" StrokeThickness="0"/>
        			</StackPanel>
        			<StackPanel x:Name="sp2" Width="440" Height="40" Background="#FF1D1D1D">
        				<Grid Margin="5,10" VerticalAlignment="Center">
        					<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Lorem Ipsum" VerticalAlignment="Top" FontSize="13.333" Foreground="#FFC4C4C4"/>
        					<TextBlock HorizontalAlignment="Right" TextWrapping="Wrap" Text="NFO" VerticalAlignment="Center" FontSize="13.333" Foreground="#FFC4C4C4" Margin="0,0,20,0"/>
        				</Grid>
        				<Rectangle Fill="#FF464646" Height="1" StrokeThickness="0"/>
        			</StackPanel>
        			<StackPanel x:Name="sp3" Width="440" Height="40" Background="#FF1D1D1D">
        				<Grid Margin="5,10,5,11" VerticalAlignment="Center">
        					<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Lorem " VerticalAlignment="Top" FontSize="13.333" Foreground="#FFC4C4C4"/>
        					<TextBlock HorizontalAlignment="Right" TextWrapping="Wrap" Text="NFO" VerticalAlignment="Center" FontSize="13.333" Foreground="#FFC4C4C4" Margin="0,0,20,0"/>
        				</Grid>
        				<Rectangle Fill="#FF464646" Height="1" StrokeThickness="0"/>
        			</StackPanel>
        			<StackPanel x:Name="sp4" Width="440" Height="40" Background="#FF1D1D1D">
        				<Grid Margin="5,11,5,10" VerticalAlignment="Center">
        					<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Lorem Ipsum" VerticalAlignment="Top" FontSize="13.333" Foreground="#FFC4C4C4"/>
        					<TextBlock HorizontalAlignment="Right" TextWrapping="Wrap" Text="NFO" VerticalAlignment="Center" FontSize="13.333" Foreground="#FFC4C4C4" Margin="0,0,20,0"/>
        				</Grid>
        				<Rectangle Fill="#FF464646" Height="1" StrokeThickness="0"/>
        			</StackPanel>
        			<StackPanel x:Name="sp5" Width="440" Height="40" Background="#FF1D1D1D">
        				<Grid Margin="5,10,5,11" VerticalAlignment="Center">
        					<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Lorem Ipsum Dolor" VerticalAlignment="Top" FontSize="13.333" Foreground="#FFC4C4C4"/>
        					<TextBlock HorizontalAlignment="Right" TextWrapping="Wrap" Text="NFO" VerticalAlignment="Center" FontSize="13.333" Foreground="#FFC4C4C4" Margin="0,0,20,0"/>
        				</Grid>
        				<Rectangle Fill="#FF464646" Height="1" StrokeThickness="0"/>
        			</StackPanel>
        		</ListView>
        		<Button x:Name="btnViewAll" Content="View All" HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="0,20,0,0" BorderThickness="0" Padding="20,5" Style="{StaticResource btnGetQuoteStyle}"/>
        	</StackPanel>
        </StackPanel>

        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
